package org.lansir.af.database;

/**
 * 
 * @author 蓝智宏
 * 
 */
public class DataRowActivityParticipator extends DataRow {

	/**
	 * 各个字段的索引 Reply： 参与者的答复 0：参加 1：不参加 2：无回复
	 * 
	 * @author Administrator
	 * 
	 */
	public static class fid {
		public static final int ID = 0;
		public static final int ActivityID = 1;
		public static final int ParticipatorID = 2;
		public static final int ParticipatorName = 3;
		public static final int IsOther = 4;
		public static final int Reply = 5;
	};

	// Table definition
	private final DataField[] TableDef = { 
			new DataField(fid.ID, "_ID", DataField.Type.INT, true, true), 
			new DataField(fid.ActivityID, "ActivityID", DataField.Type.INT, true, false),
			new DataField(fid.ParticipatorID, "ParticipatorID", DataField.Type.TEXT, true, false), 
			new DataField(fid.ParticipatorName, "ParticipatorName", DataField.Type.TEXT, true, false),
			new DataField(fid.IsOther, "IsOther", DataField.Type.BOOL, true, false),
			new DataField(fid.Reply, "Reply", DataField.Type.INT, true, false) };
	private long lID;
	private long lActivityID;
	private String sParticipatorPhone;
	private String sParticipatorName;
	private boolean sParticipatorOther;
	private int iReply;

	public DataRowActivityParticipator(Database userdb) {
		super(userdb);
		setTableDefinition(TableDef);
	}

	@Override
	public String getTableName() {
		return Database.sTableNameActivityParticipator;
	}

	
	
	public long getID() {
		return lID;
	}

	public void setID(long lid) {
		lID = lid;
	}

	@Override
	public void getValuesFromDataRow() {
		setID(value(fid.ID).asLong());
		setActivityID(value(fid.ActivityID).asLong());
		setParticipatorPhone(value(fid.ParticipatorID).asString());
		setParticipatorName(value(fid.ParticipatorName).asString());
		setOther(value(fid.IsOther).asBoolean());
		setReply(value(fid.Reply).asInt());
	}

	@Override
	public void setValuesForDataRow() {
		clearContentValues();
		value(fid.ActivityID).set(getActivityID());
		value(fid.ParticipatorID).set(getParticipatorPhone());
		value(fid.ParticipatorName).set(getParticipatorName());
		value(fid.IsOther).set(isOther());
		value(fid.Reply).set(getReply());
	}

	public long getActivityID() {
		return lActivityID;
	}

	public void setActivityID(long activityID) {
		lActivityID = activityID;
	}

	public String getParticipatorPhone() {
		return sParticipatorPhone;
	}

	public void setParticipatorPhone(String participatorPhone) {
		sParticipatorPhone = participatorPhone;
	}

	public int getReply() {
		return iReply;
	}

	public void setReply(int iReply) {
		this.iReply = iReply;
	}

	public String getParticipatorName() {
		return sParticipatorName;
	}

	public void setParticipatorName(String participatorName) {
		sParticipatorName = participatorName;
	}

	public boolean isOther() {
		return sParticipatorOther;
	}

	public void setOther(boolean bOther) {
		sParticipatorOther = bOther;
	}

	
}
